<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>学生列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="${AppPath}/css/font.css">
    <link rel="stylesheet" href="${AppPath}/css/index.css">
    <script src="${AppPath}/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="${AppPath}/js/index.js"></script>
    <script type="text/javascript" src="${AppPath}/jquery/jquery-2.1.1.min.js"></script>
</head>
<body>
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>导航元素</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="hidden" name="uId" value="${sessionScope.user.uid}">

                        </div>
                    </form>
                </div>
                <div class="layui-card-header">

                    <button class="layui-btn" onclick="update()"><i class="layui-icon"></i>修改个人信息</button>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">



                        <tbody id="studentForm" >

                        </tbody>
                    </table>
                </div>

                <div class="layui-card-body ">
                    <div class="page">
                        <div id="pageInfo">
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    function la(){
        layui.use(['laydate','form'], function(){
            var laydate = layui.laydate;
            var  form = layui.form;
            form.render();

        });
    }
    function  update(){
       var uid=$("input[name=uId]").val();

       location.href='${AppPath}/student/updateJump1?studentId='+uid;

    }

$(function () {
    showList();
})
    function showList() {
        $.ajax({
            url:"${AppPath}/student/findOne",
            type:"post",
            data:{
              "studentId":$("input[name=uId]").val()

            },
            success:function (data) {

                if(data.result=="ok"){
                    let str = "";
                        str += '<tr>';
                        str +='  <th>姓名</th> '
                        str += '<td>'+data.student.studentName+'</td></tr>';
                        str += '<tr>' +'<th>性别</th>'+
                            '<td>'+data.student.studentSex+'</td></tr>';
                        str += '<tr><th>班级</th>' +
                            '<td>'+data.student.classId.className+'</td></tr>';
                        str += '<tr>  <th>电话</th>' +
                            '<td>'+data.student.studentPhone+'</td></tr>';
                        str += '<tr><th>地址</th>' +
                            '<td>'+data.student.studentAddress+'</td></tr>';
                        str += '<tr><th>入学时间</th>' +
                            '<td>'+data.student.studentIntotime+'</td></tr>';
                        str += '<tr><th>学分</th>' +
                            '<td>'+data.student.studentGrade+'</td></tr>';
                        str += '<tr> <th>状态</th>' +
                            '<td class="td-status"><span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td></tr>';


                    $("#studentForm").html(str);
                    la();

                }else{
                    layer.msg(data.result, {time:1000, icon:5}, function(){


                    });
                }
            }
        });
    }








</script>
</html>
